<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>网页1183221-会员登录</title>
    <!-- Vue版本登录页面 -->
    <!-- 移除了自动重定向，现在可以直接访问此页面 -->
    <!-- 引入Vue 3 -->
    <script src="https://cdn.jsdelivr.net/npm/vue@3.3.4/dist/vue.global.prod.js"></script>
    <!-- 引入Axios用于HTTP请求 -->
    <script src="https://cdn.jsdelivr.net/npm/axios@1.4.0/dist/axios.min.js"></script>
    <!-- 引入CSS样式 -->
    <link rel="stylesheet" href="css/style.css">
    <style>
        /* 加载状态样式 */
        .loading-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.3);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 1000;
        }
        
        .loading-spinner {
            background-color: white;
            padding: 20px;
            border-radius: 5px;
            text-align: center;
        }
        
        .spinner {
            border: 4px solid rgba(0, 115, 207, 0.3);
            border-radius: 50%;
            border-top: 4px solid #0073cf;
            width: 30px;
            height: 30px;
            animation: spin 1s linear infinite;
            margin: 0 auto 10px;
        }
        
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        /* 错误消息样式 */
        .error-message {
            color: #e74c3c;
            font-size: 12px;
            margin-top: 5px;
            text-align: center;
        }
        
        /* 输入框图标样式 */
        .input-with-icon {
            position: relative;
            display: flex;
            align-items: center;
        }
        
        .input-icon {
            position: absolute;
            left: 10px;
            color: #666;
            z-index: 1;
        }
        
        .input-with-icon input {
            padding-left: 35px;
            width: 100%;
            box-sizing: border-box;
        }
    </style>
</head>
<body>
    <!-- 如果重定向失败，显示备用内容 -->
    <div id="app">
        <div class="login-header">
            <div class="logo">
                <span style="font-size: 18px; font-weight: bold; color: #0073cf;">TMS系统</span>
                <span >&nbsp;&nbsp;&nbsp;网页1183221-会员登录</span>
            </div>
        </div>
        <div class="content">
            <div class="center-content">
                <div class="earth-container">
                    <div class="globe">
                        <img src="http://www.sz56t.com:8082/img/lg_bj.png" alt="Login Image" style="width: 520px; height: 400px;"/>
                    </div>
                </div>
                <div class="login-form-container">
                    <div class="form-content">
                        <div class="form-title">登录</div>
                        <div class="form-group">
                            <div class="input-with-icon">
                                <span class="input-icon">👤</span>
                                <input 
                                    type="text" 
                                    v-model="username" 
                                    placeholder="用户名" 
                                    :disabled="loading"
                                    @keyup="handleKeyPress"
                                    autocomplete="username"
                                >
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="input-with-icon">
                                <span class="input-icon">🔒</span>
                                <input 
                                    type="password" 
                                    v-model="password" 
                                    placeholder="密码" 
                                    :disabled="loading"
                                    @keyup="handleKeyPress"
                                    autocomplete="current-password"
                                >
                            </div>
                        </div>
                        <div v-if="errorMessage" class="error-message">
                            {{ errorMessage }}
                        </div>
                        <button 
                            @click="login" 
                            class="login-button"
                            :disabled="loading"
                        >
                            {{ loading ? '登录中...' : '登录' }}
                        </button>
                        <div class="forgot-password">
                            <a href="#" @click.prevent="goToRegister">还没有账号？免费注册 &gt;</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="footer">
            <p>技术支持：XX科技   服务热线：0755-XXXXXXX <a href="http://www.XXX.com" target="_blank">www.jdddf.com</a></p>
        </div>
        <div v-if="loading" class="loading-overlay">
            <div class="loading-spinner">
                <div class="spinner"></div>
                <p>正在登录，请稍候...</p>
            </div>
        </div>
    </div>
    
    <!-- 引入Vue应用 -->
    <script src="js/app.js"></script>
</body>
</html>